package vip.george.bean.config.optional;


import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import vip.george.bean.animal.Cat;
import vip.george.bean.animal.Mouse;

//@Configuration
@Component
@ConditionalOnBean(name = "dog") // 没有dog名称的bean就不加载当前的配置类
public class OptionalConfig {


    @Bean
    public Mouse mouse() {
        return new Mouse();
    }


}
